/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.niedziela12.pai.ejb.room.endpoints;

import com.niedziela12.pai.ejb.dto.RoomDTO;
import com.niedziela12.pai.ejb.room.managers.RoomManagerLocal;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

/**
 *
 * @author Kamil
 */
@Stateless
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class RoomEndpoint implements RoomEndpointLocal {

    @EJB
    private RoomManagerLocal roomManager;

    @Override
    public void addNewRoom(RoomDTO room) {
        roomManager.addNewRoom(room);
    }

    @Override
    public void updateRoomInfo(RoomDTO room) {
        roomManager.updateRoomInfo(room);
    }

    @Override
    public void deleteRoom(RoomDTO room) {
        roomManager.deleteRoom(room);
    }

    @Override
    public List<RoomDTO> getRooms(int from, int to) {
        return roomManager.getRooms(from, to);
    }

    @Override
    public List<RoomDTO> getAllRooms() {
        return roomManager.getAllRooms();
    }

    @Override
    public int getRoomsCount() {
        return roomManager.getRoomsCount();
    }

    @Override
    public RoomDTO getRoom(Long id) {
        return roomManager.getRoom(id);
    }

    @Override
    public List<RoomDTO> getRoomsInHotel(Long id) {
        return roomManager.getRoomsInHotel(id);
    }
    
}
